package com.yu.crm.domain.pojo;

import com.alibaba.fastjson.annotation.JSONType;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.List;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

import com.baomidou.mybatisplus.annotation.TableLogic;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 菜单表
 * </p>
 *
 * @author donnie-bin
 * @since 2019-06-10
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@JSONType(orders = {"id"})
public class CrmMenu implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键", required = false)
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "父节点id，为空表示根节点", required = false)
    @TableField("pid")
    private Long pid;

    @ApiModelProperty(value = "菜单名称", required = true)
    @NotEmpty(message = "菜单名称不能为空")
    @TableField("menu_name")
    private String menuName;

    @ApiModelProperty(value = "菜单描述", required = true)
    @NotEmpty(message = "菜单描述不能为空")
    @TableField("menu_description")
    private String menuDescription;

    @ApiModelProperty(value = "菜单图标文件ID", required = false)
    @TableField("menu_icon_file_id")
    private String menuIconFileId;

    @ApiModelProperty(value = "排序", required = false)
    @TableField("view_order")
    private Integer viewOrder;

    @ApiModelProperty(value = "是否叶子  int(0表示叶子,1表示有下级)", required = true)
    @NotNull(message = "是否叶子字段不能为空")
    @TableField("is_leaf")
    private Integer isLeaf;

    @ApiModelProperty(value = "页面路由地址", required = false)
    @TableField("page_router")
    private String pageRouter;

    @ApiModelProperty(value = "创建时间", required = false)
    @TableField("gmt_create")
    private LocalDateTime gmtCreate;

    @ApiModelProperty(value = "修改时间", required = false)
    @TableField("gmt_modified")
    private LocalDateTime gmtModified;

    @ApiModelProperty(value = "是否已删除 yes_no", required = false)
    @TableField("is_deleted")
    private Integer isDeleted;


    @ApiModelProperty(value = "子节点列表", required = false)
    @TableField(exist = false)
    private List<CrmMenu> children;
}
